import * as echarts from 'echarts'

/**
 * 基础雷达图
 * @param el
 * @param params
 * @param name
 * @author 赵京涛
 */
export const useRadarEchartsHandler = (el, params, name) => {
  const myChart = echarts.init(el)
  const option = {
    title: {
      text: params.text || ''
    },
    radar: {
      indicator: params.indicator
    },
    tooltip: {
      trigger: 'axis'
    },
    series: [
      {
        name,
        tooltip: {
          trigger: 'item'
        },
        type: 'radar',
        data: params.seriesData
      }
    ]
  }
  option && myChart.setOption(option)
}
